package main

import "fmt"

type MyInt struct{
	n int
}

func (myInt *MyInt) Increase(){
	myInt.n++
}

func (myInt MyInt) Decrease(){
	myInt.n--
}

type Pet interface{
	Name() string
	Age() uint8
}

type Dog struct{
	name string
	age uint8
}

func (dog Dog)Name()string{
	return dog.name
}

func (dog Dog)Age()uint8{
	return dog.age
}

func main(){
	// struct method
	mi:=MyInt{}
	fmt.Println(mi.n)
	mi.Increase()
	fmt.Println(mi.n)
	mi.Decrease()
	fmt.Println(mi.n)
	myDog:=Dog{"Denny",3}
	_,ok1:=interface{}(&myDog).(Pet)
	_,ok2:=interface{}(myDog).(Pet)
	fmt.Printf("%v, %v\n",ok1,ok2)
	num1:=255
	// basic usage 
	p:=&num1
	num2:=*p
	fmt.Println(num1,p,num2)
	// pointer array
	a,b,c:=1,2,3
	ptrArr:=[...]*int{&a,&b,&c}
	fmt.Println(ptrArr)
	// array pointer
	arrPtr:=&ptrArr
	fmt.Println(arrPtr)
}